
<?php
session_start(); 
include("../../connectMysql/connetMysql.class.php");
$conClass=new connetMysql;
$con=$conClass->getConnect();
$username=$_SESSION['user'];
//$username='1百分';
$attentionnewstype=$_POST['attentionnewstype'];
//$attentionnewstype=3;
$sql="SELECT *from `user`,`attention` WHERE attentionuserid=userid AND username='$username' AND attentionnewstype=$attentionnewstype";
//echo $sql;
//SELECT *from `user`,`attention` WHERE attentionuserid=userid AND username='1百分' AND attentionnewstype=3
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result);

$readNewsId=$row['attentionlastnews'];//最后浏览新闻 ID
$newsStypeId=$attentionnewstype;

$sql="select count(*) as count from newsdraft where newstype=$newsStypeId AND newsid>$readNewsId and newsstate=1";
//echo $sql;
$result1 = mysqli_query($con,$sql);
$row2= mysqli_fetch_array($result1);
echo $row2['count'];
//echo 100;

?>